<?php 
$re = "/statM/";
$str = uri_string();
if (preg_match($re, $str)) {
    $sub = TRUE;
} else {
    $sub = FALSE;
}
?>

<div class="title-menu">
    <h2><?php echo $title;?></h2>
</div>
<nav class="bonus">
    <a href="<?php if($sub == TRUE) echo base_url("backend/orders/statM"); else echo base_url("backend/orders/stat");?>"><< Quay lại</a>
</nav>
<article>
    <table cellspacing="0" cellpadding="5" border="1">
        <tr>                  
            <th>Tên sản phẩm</th>                 
            <th>Số lượng</th>                       
        </tr>
        <?php
        if (isset($orders) && count($orders))
            foreach ($orders as $order) {
                ?>
                <tr>                                      
                    <td><?php echo $order->name; ?></td>               
                    <td><?php echo $order->qty; ?></td>                                                      
                </tr>        
                <?php
            }
        ?>
    </table>
    
</article>